home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19971216-19980424 / 000330_news@newsmaster….columbia.edu _Mon Mar 23 19:42:12 1998.msg < prev    next >
Internet Message Format  |  2020-01-01  |  5KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id TAA18558
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 23 Mar 1998 19:42:12 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id TAA04096
  7.     for kermit.misc@watsun; Mon, 23 Mar 1998 19:42:11 -0500 (EST)
  8. Path: news.columbia.edu!panix!news.panix.com!not-for-mail
  9. From: vilardi@panix.com (Greg Vilardi)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Help with simple script...
  12. Date: 23 Mar 1998 19:41:35 -0500
  13. Organization: Panix
  14. Lines: 108
  15. Message-ID: <6f6vfv$70c@panix3.panix.com>
  16. References: <6f6ncm$oku@panix3.panix.com> <6f6p4r$g7o$1@apakabar.cc.columbia.edu>
  17. NNTP-Posting-Host: panix3.panix.com
  18. X-Newsposter: trn 4.0-test55 (26 Feb 97)
  19. Xref: news.columbia.edu comp.protocols.kermit.misc:8528
  20.  
  21. In article <6f6p4r$g7o$1@apakabar.cc.columbia.edu>,
  22. Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
  23. >In article <6f6ncm$oku@panix3.panix.com>,
  24. >Greg Vilardi <vilardi@panix.com> wrote:
  25. >: Hi everyone. I am having a problem writing a simple kermit script to take a
  26. >: flatfile of command records and spit them out to a remote serial device. The
  27. >: technical details are as follows: C-Kermit v6.0.192 SCO Unix 3.2v4.2
  28. >: connected to a CX DigiBoard. The remote system is on a dedicated line,
  29. >: directly connected and standard RS232 connectivity is working fine.
  30. >: 
  31. >Using what kind of flow control?
  32. >
  33. XON / XOFF is enabled on the ports on both ends.
  34.  
  35. >: I need to have a script that will take each line of a file, and send it out
  36. >: the serial port. The script will then wait for a response from the port, and
  37. >: log both the command and the response to another file. If some kind person
  38. >: out there already has a script that does this or something very similar,
  39. >: could you please e-mail it to me? Or could someone who knows more about
  40. >: scripting than I do please tell me what is wrong with the script below? I've
  41. >: spent most of the weekend with the kermit manuals and have had no luck. I
  42. >: tried the FAQ too.  Suggestions to RTFM greatfully accepted if page numbers
  43. >: are provided. I have read chapters 17, 18 & 19 3 times already.
  44. >: ...
  45. >: Script starts below:
  46. >: 
  47. >: ; Read file $1 one line at a time and send command to paging terminal on port
  48. >: ; $3. Write return messages to $2.
  49. >: 
  50. >: def UPDATE {
  51. >:     local \%c cmd
  52. >:     if < \v(argc) 4 end 1 Usage: UPDATE infile outfile device
  53. >:     ;set take error off
  54. >:     set carrier-watch off
  55. >:     OPEN READ \%1
  56. >:     if fail end 1 Can't open \%1 for reading.
  57. >:     open write \%2
  58. >:     if fail end 1 Can't open \%2 for writing.
  59. >:     set line \%3
  60. >:     if fail end 1 Cant open port \%3
  61. >:     set speed 9600
  62. >:
  63. >C-Kermit defaults to Xon/Xoff flow control.  Is that what you want to
  64. >use?  If so, is the other system set up for it too?
  65. >
  66. Yes, see above.
  67.  
  68. >:     set input silence 2
  69. >:     set input timeout-action proceed
  70. >:     set input echo off
  71. >:     define \%c 0
  72. >:     while true {
  73. >:         read cmd
  74. >:         xif fail {
  75. >:             close write 
  76. >:             end 0 Commands processed: \%c.
  77. >:         }
  78. >:         increment \%c
  79. >: ;        writeln debug-log \m(cmd) \m(\%c)
  80. >:         output \m(cmd) \13\10
  81. >:         input 10 \10
  82. >:         xif fail {
  83. >:             close read
  84. >:             close write
  85. >:             end 1 Terminal did not respond.
  86. >:         }
  87. >:         writeln file \m(cmd)
  88. >:         writeln file \v(input)
  89. >:     }
  90. >: }
  91. >: log debug debug.log
  92. >: update termrecs termrecs.out /dev/ttya01
  93. >: close debug
  94. >
  95. >That's a very well-written script, using all the appropriate mechanisms
  96. >and using them correctly; nothing stands out as suspect.
  97. Thank you.
  98.  
  99. >
  100. >So in what way does it not work?  What, exactly are the symptoms?
  101. >Do any lines get through?  Do you ever get a LF back from the terminal?
  102. >
  103. >In other words, is it a basic connectivity problem, or a problem with
  104. >the execution of the script?
  105.  
  106. I'm sorry I didn't describe this the first time. It seems to hang before 
  107. transmitting the first line. The take command hangs and when I hit ^C to 
  108. get the control back the system seems to flush it's buffers. My test setup 
  109. only has pins 2,3&7 (DB25) wired. I can type the same commands and see a
  110. response, so I doubt that it is strictly an RS232 problem. I will play with the
  111. flow control settings. I just re-tried sending a command by hand and that isn't
  112. working at the moment either. Argh. Something must be screwy in the test bed.
  113. I just checked the other side of the system. characters are not coming back 
  114. into kermit though they are transmitted on the other side. If you have any 
  115. other ideas, please let me know. I'll test this further tomorrow.
  116.  
  117. Thanks for the prompt and insightful reply.
  118.  
  119.     -Greg
  120. >
  121. >- Frank
  122.  
  123.  
  124. -- 
  125. Greg Vilardi, Host: Scanner Cinema East            E-mail:vilardi@panix.com
  126. USnail: 354 Indian Head Rd|In-Touch Management Systems | Home:(516)864-1310
  127. Commack, NY 11725         |Melville, NY 11747      | Work:(516)752-2701x240
  128. .sig Version 0.50(beta release)               I thought, I wrote, I posted.